/*
 * This file (AkBrush.java) is protected by the GNU GPL licence (v2). 
 * Please read the license.txt attached for further informations. 
 * 
 */

package alkwarel.objects;

import artx.objects.AxArtspace;

/**
 * Basic Alkwarel Brush class. Use it through the
 * {@link AkBrush#DrawStroke(AkArtspace, float, float, float, float)} method
 * instead of just {@link AkBrush#Apply(AxArtspace)}
 * 
 * @author Xavier Gouchet
 * 
 */
public abstract class AkBrush extends AkActuator {

	/**
	 * Standard Constructor.
	 * 
	 * @param id
	 *            the object's id
	 * @param name
	 *            the object's name
	 */
	public AkBrush(int id, String name) {
		super(id, name, new String[]{"brush step","float"});
	}

	/**
	 * Draws a stroke between the given point.
	 * 
	 * @param a
	 *            the Alkwarel Artspace on which the brush is applied
	 * @param srcx
	 *            the origin of the stroke (x value)
	 * @param srcy
	 *            the origin of the stroke (y value)
	 * @param destx
	 *            the destination of the stroke (x value)
	 * @param desty
	 *            the destination of the stroke (y value)
	 * @return boolean whether the method has been completed successfully or not
	 */
	public abstract boolean DrawStroke(AkArtspace a, float srcx, float srcy,
			float destx, float desty);

	/**
	 * @see alkwarel.objects.AkActuator#Apply(alkwarel.objects.AkArtspace)
	 */
	public final boolean Apply(AkArtspace a){
		return this.DrawStroke(a, a.mouseX, a.mouseY, a.mouseX, a.mouseY);
	}
}
